package com.runme.chatrobot.models;


import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by nivalsoul on 2015/10/30.
 */
public class ChatMsg {
    private Date date;
    private String content;
    private Type type;

    public ChatMsg(Date date, String content, Type type) {
        this.date = date;
        this.content = content;
        this.type = type;
    }

    public ChatMsg(String content, Type type) {
        date=new Date();
        this.content = content;
        this.type = type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public String getDate() {
        SimpleDateFormat sf=new SimpleDateFormat("yyMMdd HH:mm:ss");
        if (date!=null){
            return  sf.format(date);
        }
        else {
            date= new Date();
            return sf.format(date);
        }
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public enum Type{
        FROM,TO;
    }
}
